{% extends 'base.html' %}
{% load static %}
{% block title %}用例集合用例执行结果{% endblock %}
{% block content %}
<div class="table-responsive">
    <table class="table table-striped">
        <thead>
        <tr>
            <th width="5%">执行id</th>
            <th width="6%">集合名称</th>
            <th width="5%">用例名称</th>
            <th width="5%">状态</th>
            <th width="18%">请求数据</th>
            <th width="15%">执行返回结果</th>
            <th width="5%">操作</th>
            <th width="8%">断言内容</th>
            <th width="5%">执行结果</th>
            <th width="5%">异常信息</th>
            <th width="8%">请求后提取变量</th>
            <th width="8%">开始时间</th>
            <th width="8%">执行耗时</th>

        </tr>
        </thead>
        <tbody>
        {% for case_execute_record in suite_case_execute_records %}
        <tr>
            <td>{{ case_execute_record.id }}</td>
            <td>{{  case_execute_record.case_suite_record.case_suite.suite_desc}}</td>
            <td><a href="{% url 'suite_case_execute_record' case_execute_record_test_case.id %}"></a></td>
            {% if case_execute_record.status %}
            <td>执行完毕</td>
            {% else %}
            <td>待执行</td>
            {% endif %}
           <td>{{ case_execute_record.request_data }}</td>
        <td>{{ case_execute_record.response_data }}</td>
        <td><a href="{% url 'suite_case_result_diff' case_execute_record.id%}" target="_blank">对比差异</a></td>
        <td>{{ case_execute_record.test_case.assert_key }}</td>

        {% ifequal case_execute_record.execute_result '成功' %}
        <td bgcolor='green'>{{ case_execute_record.execute_result}}</td>
        {% else %}
        <td bgcolor='red'>{{ case_execute_record.execute_result}}</td>
        {% endifequal %}

        {% if case_execute_record.exception_info %}
              <td><a href="{% url 'suite_case_exception' case_execute_record.id%}" target="_blank">显示异常</a></td>
        {% else %}
        <td>无</td>
        {% endif %}
        <td>{{ case_execute_record.extract_var }}</td>
        <td>{{ case_execute_record.execute_start_time }}</td>
        <td>{{ case_execute_record.execute_total_time }}</td>
        </tr>
        {% endfor %}
        </tbody>
    </table>
</div>
<div id="pages" class="text-center">
    <nav>
        <ul class="pagination">
            <li class="step-links">
                {% if suite_case_execute_records.has_previous  %}
                <a  class="active" href="?page={{ suite_case_execute_records.previous_page_number }}">上一页</a>
                {% endif %}
            <span class="current"> 第 {{ suite_case_execute_records.number}} 页 / 共 {{ suite_case_execute_records.paginator.num_pages }} 页</span>
            {% if suite_case_execute_records.has_next %}
            <a class="active" href=">page={{ suite_case_execute_records.next_page_number}}"></a>
            {% endif %}
            </li>
        </ul>
    </nav>
</div>
{% endblock %}